
import textwrap

class UserV:
    # 构造函数
    def __init__(self,
    id,
    sid,
    name,
    qq,
    autocard,
    sendEmail,
    sname
    ) -> None:
        self.__id = id
        self.__sid = sid
        self.__name = name
        self.__qq = qq
        self.__autocard = 1 if autocard else 0
        self.__sendEmail = 1 if sendEmail else 0
        self.__sname = sname

    @property
    def id(self):
        return self.__id
    @id.setter
    def id(self,value):
        self.__id = value

    @property
    def sid(self):
        return self.__sid
    @sid.setter
    def sid(self,value):
        self.__sid = value

    @property
    def name(self):
        return self.__name
    @name.setter
    def name(self,value):
        self.__name = value

    @property
    def qq(self):
        return self.__qq
    @qq.setter
    def qq(self,value):
        self.__qq = value

    @property
    def autocard(self):
        return self.__autocard
    @autocard.setter
    def autocard(self,value):
        self.__autocard = value

    @property
    def sendEmail(self):
        return self.__sendEmail
    @sendEmail.setter
    def sendEmail(self,value):
        self.__sendEmail = value

    @property
    def sname(self):
        return self.__sname
    @sname.setter
    def sname(self,value):
        self.__sname = value

    def toString(self):
        return textwrap.dedent(f"""\
            id={self.__id},
            sid={self.__sid},
            name={self.__name},
            qq={self.__qq},
            autocard={self.__autocard},
            sendEmail={self.__sendEmail},
            sname={self.__sname}.
        """)

    def toDic(self):
        return {
            'id': self.__id,
            'sid': self.__sid,
            'name': self.__name,
            'qq': self.__qq,
            'autocard': True if self.__autocard else False,
            'sendEmail': True if self.__sendEmail else False,
            'sname': self.__sname
        }

    def toCell(self):
        return (
            self.__id,
            self.__sid,
            self.__name,
            self.__qq,
            self.__autocard,
            self.__sendEmail,
            self.__sname
        )